<template>
  <div class="expenditure">
    <el-form :inline="true" class="demo-form-inline">
      <el-form-item label="生日起止时间：">
        <div class="block">
          <el-date-picker
            v-model="value"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          />
        </div>
      </el-form-item>
      <el-form-item>
        <el-button type="" class="el-icon-search" @click="onSubmit()"
          >查询</el-button
        >
        <el-button class="el-icon-printer">打印</el-button>
      </el-form-item>
    </el-form>
    <el-form>
      <el-form-item label="征地项目：">
        <el-select v-model="state" placeholder="请选择">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
      </el-form-item>
    </el-form>
    <!-- 支出申请表格 -->
    <div v-show="this.expapply">
      <el-table
       :header-cell-style="{ 'text-align': 'center' }"
      :cell-style="{ 'text-align': 'center' }"  
        ref="multipleTable"
        :data="tableData"
        tooltip-effect="dark"
        style="width: 700px"
      >
        <el-table-column prop="name" label="姓名" width="150">
        </el-table-column>
        <el-table-column prop="address" label="支出金额" width="150px">
        </el-table-column>
        <el-table-column prop="name" label="操作员" width="200">
        </el-table-column>
        <el-table-column prop="name" label="操作时间" width="200">
        </el-table-column>
        <el-table-column prop="name" label="审核员" width="200">
        </el-table-column>
        <el-table-column prop="name" label="审核时间" width="200">
        </el-table-column>
      </el-table>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="currentPage3"
        :page-size="100"
        layout="prev, pager, next, jumper"
        :total="this.tableData.length"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      msg: "支出制单查询",
      state: "", // 状态
      value: "", // 起止时间
      tableData: [],
      currentPage3: 1,
      expapply: false,
      options: [], // 操作员列表
    };
  },
  methods: {
    onSubmit() {
      if (this.value == "") {
        console.log("submit!!!");
      } else {
        const timestart =
          this.value[0].getFullYear() +
          "-" +
          (this.value[0].getMonth() + 1) +
          "-" +
          this.value[0].getDate();
        const timeend =
          this.value[1].getFullYear() +
          "-" +
          (this.value[1].getMonth() + 1) +
          "-" +
          this.value[1].getDate();
        console.log(timestart); // 开始时间
        console.log(timeend); // 结束时间
      }
      this.expapply = true;
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
  },
};
</script>

<style scoped lang="scss">
.expenditure {
  padding: 30px;
  .el-pagination {
    max-width: 700px;
    margin-top: 10px;
    text-align: right;
  }
}
</style>
